package net.pimpas.web.jsf.components.ajax.populate.autoupdate;

import javax.faces.component.UIComponent;

import net.pimpas.web.jsf.components.ajax.populate.UIAjaxPopulateTag;

public class UIAjaxPopulateAutoUpdateTag extends UIAjaxPopulateTag {
	
	private int timer;
	
	@Override
	protected void setProperties(UIComponent component) {
		this.setEvent(""); // hax
		super.setProperties(component);
		
		UIAjaxPopulateAutoUpdate autoUpdate = (UIAjaxPopulateAutoUpdate) component;
		if(this.getTimer() < 0) this.setTimer(UIAjaxPopulateAutoUpdate.DEFAULT_TIMER);
		
		autoUpdate.setTimer(this.getTimer());
	}

	@Override
	public String getComponentType() {
		return UIAjaxPopulateAutoUpdate.COMPONENT_TYPE;
	}

	public int getTimer() {
		return timer;
	}

	public void setTimer(int timer) {
		this.timer = timer;
	}
	
	
}